{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import threading"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def thread_job():\n",
    "    print('This is an added Thread,number is %s'% threading.current_thread())\n",
    "    \n",
    "\n",
    "\n",
    "def main():\n",
    "    added_thread = threading.Thread(target=thread_job)\n",
    "    added_thread.start()\n",
    "  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "5\n",
      "[<_MainThread(MainThread, started 13188)>, <Thread(Thread-4, started daemon 9120)>, <Heartbeat(Thread-5, started daemon 6116)>, <HistorySavingThread(IPythonHistorySavingThread, started 11880)>, <ParentPollerWindows(Thread-3, started daemon 10576)>]\n",
      "<_MainThread(MainThread, started 13188)>\n"
     ]
    }
   ],
   "source": [
    "if __name__ == '__main__':\n",
    "    main()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "5\n",
      "[<_MainThread(MainThread, started 13188)>, <Thread(Thread-4, started daemon 9120)>, <Heartbeat(Thread-5, started daemon 6116)>, <HistorySavingThread(IPythonHistorySavingThread, started 11880)>, <ParentPollerWindows(Thread-3, started daemon 10576)>]\n",
      "<_MainThread(MainThread, started 13188)>\n"
     ]
    }
   ],
   "source": [
    "if __name__ == '__main__':\n",
    "    main()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
